<template>
	<view :class="['vh100',{'dark':theme == 'dark'}]">
		
		<u-collapse ref="ucoll">
				<u-collapse-item :title="item.title" v-for="(item, index) in list" :key="index">
					<u-parse :html="item.content">
					</u-parse>
				</u-collapse-item>
			</u-collapse>
	</view>
</template>

<script>
	import {mapState,mapActions,mapGetters} from 'vuex';
	import {
		commonArticle
	} from '../../common/apiString.js'
	import {myMixins} from '@/common/myMixins.js'//加入全局下拉刷新
	export default{
		mixins:[myMixins],
		data() {
			return {
				content: ``,
				list:[],
			}
		},
		computed:{
			...mapState({
			  theme:state=>state.theme
			}),
		},
		onLoad() {
			uni.setNavigationBarTitle({
				title:this.$t('about.abt'),
			})
			this.$utils.setTheme(this.theme);
			
		},
		onShow(){
			this.getHtml()
		},
		beforeDestroy() {
		      clearInterval(this.timer)
		    },
		methods:{
			init(){
				
				this.$nextTick(this.$refs.ucoll.init())
			},
			getHtml(){
				this.$utils.initData({
					url: commonArticle,
					data: {
						type: 'ABOUT',
						language:uni.getStorageSync('lang')
					},
					type: 'post'
				}, (res, msg) => {
					//uni.stopPullDownRefresh();
					//this.content=res.content
					this.list=res
					this.timer = setInterval(this.init, 10000);
				})
			}
		}
	}
</script>

<style lang="scss">
	.plr20 {
	    padding-left: 4vw;
	    padding-right: 4vw;
	}
</style>
